package com.example.novelstory.service.dxy;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.example.novelstory.dao.dxy.AuthorDao;
import com.example.novelstory.entity.Author;
import java.util.List;
import org.springframework.stereotype.Service;

@Service
public class AuthorServicelmpl extends ServiceImpl<AuthorDao,Author> {
//    @Autowired
//    AuthorDao authorDao;
//
//    @Override
    public List<Author> findauthorAll() {
//        List<Author> all = authorDao.findauthorAll();
        return list();
    }

//    @Override
    public Boolean addauthorInfo(Author author) {
//        int addauthorInfo = authorDao.addauthorInfo(id,authorname,username,login_time);
//        if (addauthorInfo == 1) {
//            List<Author> all = authorDao.findauthorAll();
//            return all;
//        } else {
            return save(author);

        }

//    }

//    @Override
    public Boolean deleteauthorInfo(int id) {
//        int userauthorInfo = authorDao.deleteauthorInfo(id);
//        if (userauthorInfo == 1) {
//            List<Author> all = authorDao.findauthorAll();
//            return all;
//        } else {
            return removeById(id);

        }

//    }

//    @Override
    public Boolean updeteauthorInfo(Author author)   {
//        int updeteauthorInfo = authorDao.updeteauthorInfo(id,authorname,username,login_time);
//        if (updeteauthorInfo == 1) {
//            List<Author> all = authorDao.findauthorAll();
//            return all;
//        } else {
            return updateById(author);

        }

    }
//}
